package com.xiaoxu.base.exception;

/**
 * @author xiaoxu
 * @version 1.0
 * @description 贝壳学堂自定义异常
 * @date 2023/1/17 14:16
 */
public class bkSchoolException extends RuntimeException{
 private static final long serialVersionUID = 5565760508056698922L;
 /**
  * 异常信息
  */
 private String errMessage;

 public bkSchoolException() {
  super();
 }

 public bkSchoolException(String errMessage) {
  super(errMessage);
  this.errMessage = errMessage;
 }

 public String getErrMessage() {
  return errMessage;
 }

 public static void cast(CommonError commonError){
  throw new bkSchoolException(commonError.getErrMessage());
 }
 public static void cast(String errMessage){
  throw new bkSchoolException(errMessage);
 }

}
